

#ifndef PF_INFORMATION_H
#define PF_INFORMATION_H

#include "pf_entitycontainer.h"
#include "pf_line.h"
#include "pf_arc.h"
#include "lx_Export.h"



/**
 * Class for getting information about entities. This includes
 * also things like the end point of an element which is 
 * nearest to a given coordinate.
 * There's no interaction handled in this class.
 * This class is bound to an entity container.
 *

 */
class LX_EXPORT PF_Information {
public:
    PF_Information(PF_Container& entityContainer);

	static bool isDimension(LX_Define::EntityType type);
	static bool isTrimmable(PF_Entity* e);
	static bool isTrimmable(PF_Entity* e1, PF_Entity* e2);

    PF_Vector getNearestEndpoint(const PF_Vector& point,
                                 double* dist = NULL) const;
    PF_Vector getNearestPointOnEntity(const PF_Vector& point,
	                                  bool onEntity=true, 
                                      double* dist = NULL,
                                      PF_Entity** entity=NULL) const;
    PF_Entity* getNearestEntity(const PF_Vector& point,
                                double* dist = NULL,
                                LX_Define::ResolveLevel level=LX_Define::ResolveAll) const;

    static PF_VectorSolutions getIntersection(PF_Entity* e1,
            PF_Entity* e2,
            bool onEntities = false);

    static PF_VectorSolutions getIntersectionLineLine(PF_Line* e1,
            PF_Line* e2);

    static PF_VectorSolutions getIntersectionLineArc(PF_Line* line,
            PF_Arc* arc);

    static PF_VectorSolutions getIntersectionArcArc(PF_Arc* e1,
            PF_Arc* e2);
    
	static PF_VectorSolutions getIntersectionLineEllipse(PF_Line* line,
            PF_Ellipse* ellipse);

    static bool isPointInsideContour(const PF_Vector& point,
                                     PF_Container* contour,
									 bool* onContour=NULL);
	
protected:
    PF_Container* container;
};



#endif
